const App = {
    mixins: [Query],//配置文件，路径/utils/mixins.js
    data() {
        return {
            photo,
            page: {
                activeName:'first',
                Date:new Date().getFullYear(),
                value1:'',
                value2:'',
                PageNumber: 1, //页码
                RowAmount: 10,
                Condition: window.btoa(unescape(encodeURIComponent("%%,"+ new Date().getFullYear()+",%%")))
            },
            str1:'',
            str:'',
        }
    },
    mounted() {

    },
    methods: {
        check(){
            this.page.Condition = window.btoa(unescape(encodeURIComponent("%" + this.page.value1 + "%,"+this.page.Date +",%" +  this.page.value2 + "%")));
            this.postgetList(this.page);
        },
        Treedata() {
            let { TableName, NodeCode } = JSON.parse(document.getElementById("tree").getAttribute("data-options"));
            $.ajax({
                headers: requestHeaders(),
                url: `${mh}/generalBusiness/generalQueryByTableName`,
                type: "POST",
                data: {
                    Data:TableName,
                    Condition:"Row_Status='0'"
                },
                success: (data) => {
                    this.treeData = data; // 直接使用 this
                },
                complete: (XMLHttpRequest) => {
                    requestPretreatment(XMLHttpRequest);
                },
                dataType: "json",
            });
        },
        handleClick(){
            if (this.page.activeName == 'first') {
                this.str1 = '';
            } else if (this.page.activeName == 'second') {
                this.str1 = "\r\nAND news.Row_Status = '2'";
            } else if (this.page.activeName == 'third') {
                this.str1 = "\r\nAND news.Row_Status = '0'";
            } else if (this.page.activeName == 'fourth') {
                this.str1 = "\r\nAND news.Row_Status = '3'";
            }
            this.page.ExtensionCondition = window.btoa(unescape(encodeURIComponent(this.str + this.str1)));
            this.postgetList(this.page)
        },
        //树的点击筛选事件
        handleNodeClick(data, node) {
            console.log(data.Yield_Report_Category_SerialNumber);
            this.page.value2 = data.Yield_Report_Category_SerialNumber;
            this.page.Condition = window.btoa(unescape(encodeURIComponent("%" + this.page.value1 + "%,"+this.page.Date +",%" +  this.page.value2 + "%")));
            this.postgetList(this.page);
        },
    },
};

const { createApp } = Vue;
const app = createApp(App);
//这种方式是引入全部图标，无需单个引入
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}
const ElMessage = ElementPlus.ElMessage;
app.use(ElementPlus,{locale: zhCn});
app.mount("#app");
